

<template tag="以下文档内容为hycli自动生成">
  <el-dialog
    v-model="conf.visible"
    
    :title="title"
    :width="conf.width"
    draggable
    align-center="true"
    :close-on-click-modal="false"
  >
<el-form :model="form"  ref="form" :rules="rules_aaalp">
    <el-row>
    <el-col :span="12">
    <!-- {"index":36,"raw":"name","name":"name","cname":"Name","type":{"raw":"varchar(50)","name":"varchar","len":50,"dlen":0},"defValue":"","allowNull":false,"constraints":["l","le","v","c","u","q","lw(200)"],"desc":{"raw":"名称","name":"名称"}} -->
    <!--名称 输入控件 -->
    <el-form-item prop="name" label="名称" label-width="100px" label-position="right">
      <el-input clearable style="width: 100%" v-model="form.name"  maxlength="50" 
      :rows="0"  placeholder="请输入名称"  />
      </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":37,"raw":"company","name":"company","cname":"Company","type":{"raw":"varchar(50)","name":"varchar","len":50,"dlen":0},"defValue":"","allowNull":false,"constraints":["l","le","v","c","u","q","fq"],"desc":{"raw":"所属公司","name":"所属公司"}} -->
    <!--所属公司 输入控件 -->
    <el-form-item prop="company" label="所属公司" label-width="100px" label-position="right">
      <el-input clearable style="width: 100%" v-model="form.company"  maxlength="50" 
      :rows="0"  placeholder="请输入所属公司"  />
      </el-form-item>
    </el-col>
    <el-col :span="24">
    <!-- {"index":38,"raw":"mall_address","name":"mall_address","cname":"MallAddress","type":{"raw":"varchar(100)","name":"varchar","len":100,"dlen":0},"defValue":"","allowNull":false,"constraints":["l","le","v","c","u","rows(1)","tp(link,l-le-v)"],"desc":{"raw":"商城 地址","name":"商城"}} -->
    <!--商城 输入控件 -->
    <el-form-item prop="mall_address" label="商城" label-width="100px" label-position="right">
      <el-input clearable style="width: 100%" v-model="form.mall_address"  maxlength="100" 
      :rows="1"  type="textarea" show-word-limit  placeholder="请输入商城 地址"  />
      </el-form-item>
    </el-col>
    <el-col :span="24">
    <!-- {"index":39,"raw":"system_address","name":"system_address","cname":"SystemAddress","type":{"raw":"varchar(100)","name":"varchar","len":100,"dlen":0},"defValue":"","allowNull":false,"constraints":["le","v","c","u","rows(1)","tp(link,l-le-v)"],"desc":{"raw":"运营系统 地址","name":"运营系统"}} -->
    <!--运营系统 输入控件 -->
    <el-form-item prop="system_address" label="运营系统" label-width="100px" label-position="right">
      <el-input clearable style="width: 100%" v-model="form.system_address"  maxlength="100" 
      :rows="1"  type="textarea" show-word-limit  placeholder="请输入运营系统 地址"  />
      </el-form-item>
    </el-col>
    <el-col :span="24">
    <!-- {"index":40,"raw":"supplier_address","name":"supplier_address","cname":"SupplierAddress","type":{"raw":"varchar(100)","name":"varchar","len":100,"dlen":0},"defValue":"","allowNull":false,"constraints":["le","v","c","u","rows(1)","tp(link,l-le-v)"],"desc":{"raw":"供货商 地址","name":"供货商"}} -->
    <!--供货商 输入控件 -->
    <el-form-item prop="supplier_address" label="供货商" label-width="100px" label-position="right">
      <el-input clearable style="width: 100%" v-model="form.supplier_address"  maxlength="100" 
      :rows="1"  type="textarea" show-word-limit  placeholder="请输入供货商 地址"  />
      </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":41,"raw":"ipr","name":"ipr","cname":"Ipr","type":{"raw":"number(2)","name":"number","len":2,"dlen":0},"defValue":"","allowNull":false,"constraints":["le","v","c","u","sl","tp(radio,c-u)","color"],"desc":{"raw":"知识产权","name":"知识产权"}} -->
    <el-form-item prop="ipr" label="知识产权" label-width="100px" label-position="right">
      <el-radio-group v-model="form.ipr"   >
        <el-radio-button v-for="item in iprList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":42,"raw":"deploy_type","name":"deploy_type","cname":"DeployType","type":{"raw":"number(2)","name":"number","len":2,"dlen":0},"defValue":"","allowNull":false,"constraints":["le","v","c","u","sl","tp(radio,c-u)","color"],"desc":{"raw":"部署方式","name":"部署方式"}} -->
    <el-form-item prop="deploy_type" label="部署方式" label-width="100px" label-position="right">
      <el-radio-group v-model="form.deploy_type"   >
        <el-radio-button v-for="item in deploy_typeList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":43,"raw":"system_category","name":"system_category","cname":"SystemCategory","type":{"raw":"number(2)","name":"number","len":2,"dlen":0},"defValue":"","allowNull":false,"constraints":["l","le","v","c","u","sl","fq","tp(radio,c-u)","color"],"desc":{"raw":"系统分类","name":"系统分类"}} -->
    <el-form-item prop="system_category" label="系统分类" label-width="100px" label-position="right">
      <el-radio-group v-model="form.system_category"   >
        <el-radio-button v-for="item in system_categoryList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":44,"raw":"project_type","name":"project_type","cname":"ProjectType","type":{"raw":"number(2)","name":"number","len":2,"dlen":0},"defValue":"","allowNull":false,"constraints":["le","v","c","u","sl","tp(radio,c-u)","color"],"desc":{"raw":"项目类型\u003cbr/\u003e成熟项目: 稳定和持续的交易量，项目盈利\u003cbr/\u003e孵化项目: 交易量未知，处于模式试验期","name":"项目类型"}} -->
    <el-form-item prop="project_type" label="项目类型" label-width="100px" label-position="right">
      <el-radio-group v-model="form.project_type"   >
        <el-radio-button v-for="item in project_typeList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
      <el-tooltip raw-content="true" content="项目类型<br/>成熟项目: 稳定和持续的交易量，项目盈利<br/>孵化项目: 交易量未知，处于模式试验期" placement="bottom" effect="light">
      <i class="form_item_info fa fa-info-circle"  aria-hidden="true" />
      </el-tooltip>
    </el-form-item>
    </el-col>
    <el-col :span="24">
    <!-- {"index":45,"raw":"pm","name":"pm","cname":"Pm","type":{"raw":"number(8)","name":"number","len":8,"dlen":0},"defValue":"","allowNull":false,"constraints":["l","le","v","c","u","q","fq","sl(operprs)","tp(radio,c-u)","ps(full)","color","tp(multiselect,q)"],"desc":{"raw":"项目经理","name":"项目经理"}} -->
    <el-form-item prop="pm" label="项目经理" label-width="100px" label-position="right">
      <el-radio-group v-model="form.pm"   >
        <el-radio-button v-for="item in pmList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="24">
    <!-- {"index":46,"raw":"operation_owner","name":"operation_owner","cname":"OperationOwner","type":{"raw":"number(8)","name":"number","len":8,"dlen":0},"defValue":"","allowNull":false,"constraints":["l","le","v","c","u","q","fq","sl(operprs)","tp(radio,c-u)","ps(full)","tp(multiselect,q)"],"desc":{"raw":"基础运营","name":"基础运营"}} -->
    <el-form-item prop="operation_owner" label="基础运营" label-width="100px" label-position="right">
      <el-radio-group v-model="form.operation_owner"   >
        <el-radio-button v-for="item in operation_ownerList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":47,"raw":"supply_type","name":"supply_type","cname":"SupplyType","type":{"raw":"number(2)","name":"number","len":2,"dlen":0},"defValue":"","allowNull":true,"constraints":["le","v","c","u","sl","tp(radio,c-u)","color"],"desc":{"raw":"供货类型","name":"供货类型"}} -->
    <el-form-item prop="supply_type" label="供货类型" label-width="100px" label-position="right">
      <el-radio-group v-model="form.supply_type"   >
        <el-radio-button v-for="item in supply_typeList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="24">
    <!-- {"index":48,"raw":"memo","name":"memo","cname":"Memo","type":{"raw":"varchar2(200)","name":"varchar2","len":200,"dlen":0},"defValue":"","allowNull":true,"constraints":["c","le","u","v","rows(4)","cpr","lw(60)","rx","fx"],"desc":{"raw":"备注","name":"备注"}} -->
    <!--备注 输入控件 -->
    <el-form-item prop="memo" label="备注" label-width="100px" label-position="right">
      <el-input clearable style="width: 100%" v-model="form.memo"  maxlength="200" 
      :rows="4"  type="textarea" show-word-limit  placeholder="请输入备注"  />
      </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":51,"raw":"status","name":"status","cname":"Status","type":{"raw":"tinyint(1)","name":"tinyint","len":1,"dlen":0},"defValue":"1","allowNull":false,"constraints":["le","c","u","q","v","sl(ustatus)","tp(radio,c-u)","tp(xtabs,q,ustatus)","rp"],"desc":{"raw":"状态","name":"状态"}} -->
    <el-form-item prop="status" label="状态" label-width="100px" label-position="right">
      <el-radio-group v-model="form.status"   >
        <el-radio-button v-for="item in statusList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    </el-row>
</el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="hide" icon="close">取消</el-button>
        <el-button type="primary" @click="save" icon="select">提交</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script>
import rtext from "@/views/cmpnts/rtext.vue"
export default {
  components: {
    rtext
},
  data() {
    return {
      conf: {
        visible: false,
        width:"60%",
        uploadPath:this.$theia.env.join("/file/upload"),
      },
      title:"修改商城管理",
rules_aaalp:{
    name:[{required:true,message:"请输入名称",trigger: 'blur'}],
    company:[{required:true,message:"请输入所属公司",trigger: 'blur'}],
    mall_address:[{required:true,message:"请输入商城",trigger: 'blur'}],
    system_address:[{required:true,message:"请输入运营系统",trigger: 'blur'}],
    supplier_address:[{required:true,message:"请输入供货商",trigger: 'blur'}],
    ipr:[{required:true,message:"请输入知识产权",trigger: 'blur'}],
    deploy_type:[{required:true,message:"请输入部署方式",trigger: 'blur'}],
    system_category:[{required:true,message:"请输入系统分类",trigger: 'blur'}],
    project_type:[{required:true,message:"请输入项目类型",trigger: 'blur'}],
    pm:[{required:true,message:"请输入项目经理",trigger: 'blur'}],
    operation_owner:[{required:true,message:"请输入基础运营",trigger: 'blur'}],
    supply_type:[{required:false,message:"请输入供货类型",trigger: 'blur'}],
    memo:[{required:false,message:"请输入备注",trigger: 'blur'}],
    status:[{required:true,message:"请输入状态",trigger: 'blur'}],
  },
    form:{
        name:"",
        company:"",
        mall_address:"",
        system_address:"",
        supplier_address:"",
        ipr:"",
        deploy_type:"",
        system_category:"",
        project_type:"",
        pm:"",
        operation_owner:"",
        supply_type:"",
        memo:"",
        status:"",
    },
    iprList:[],
    deploy_typeList:[],
    system_categoryList:[],
    project_typeList:[],
    pmList:[],
    operation_ownerList:[],
    supply_typeList:[],
    statusList:[],
    }
  },
  methods: {
    show(form) {
      this.conf.visible = true;
      this.loadEnums_aaalp()
      this.form = Object.assign(form,this.$route.params)
      this.get(form)
    },
      get(form){
        let that = this
        this.conf.loading = true
        let postForm = {}
        postForm.sm_id = form.sm_id
        this.$theia.http.get("/ws/sys/management",postForm).then(res=>{
          that.form = Object.assign(that.form, res)
        //处理枚举重新绑定
          this.loadEnums_aaalp()
          that.conf.loading = false
        }).catch(res=>{
          let code = ((res||{}).response||{}).status||0
          let msg = `商城管理查询失败(${code})`
          that.$notify.error({title: '失败',message:msg ,duration:5000})
        })
    },
    save(){
        this.$refs.form.validate((v=>{
            if(v) this.onSave()
        }))
    },
    onSave(){
      let that = this
        let postForm = Object.assign({},this.form)
        this.$theia.http.put("/ws/sys/management",postForm).then(res=>{
            that.$notify.success({title: '成功',message: '商城管理保存成功',duration:5000})
            that.hide()
            that.$emit("onsaved")
        }).catch(res=>{
            let code = ((res||{}).response||{}).status||0
            let msg = `商城管理修改失败(${code})`
            that.$notify.error({title: '失败',message: msg,duration:5000})
        })
    },
    hide() {
      this.conf.visible = false;
      this.$refs.form.resetFields();
    },
     onUploadSuccess(response){
    },
    loadEnums_aaalp(){
        //知识产权
        this.iprList = this.$theia.enum.get("ipr","","" ,false,"")
        //部署方式
        this.deploy_typeList = this.$theia.enum.get("deploy_type","","" ,false,"")
        //系统分类
        this.system_categoryList = this.$theia.enum.get("system_category","","" ,false,"")
        //项目类型
        this.project_typeList = this.$theia.enum.get("project_type","","" ,false,"")
        //项目经理
        this.pmList = this.$theia.enum.get("operprs","","" ,false,"")
        //基础运营
        this.operation_ownerList = this.$theia.enum.get("operprs","","" ,false,"")
        //供货类型
        this.supply_typeList = this.$theia.enum.get("supply_type","","" ,false,"")
        //状态
        this.statusList = this.$theia.enum.get("ustatus","","" ,false,"")
    },

  },
};
</script>

<style scoped>
.form_item_info{
  margin-left: 4px;
  color:#999;
}
.form_item_info:hover{
  cursor: pointer;
  font-weight: 500;
  color:#333;
}
</style>